/**
 * ModalSheet 组件系统统一导出
 *
 * 🎯 导出策略：
 * 1. 组件导出：主组件和子组件
 * 2. 钩子导出：从 hooks/index.ts 统一导入
 * 3. 类型导出：所有相关类型定义
 * 4. 复合组件：便捷的组合使用方式
 */

// 导入组件
import ModalSheetComponent from './ModalSheet';
import ModalSheetHeaderComponent from './ModalSheetHeader';
import ModalSheetBodyComponent from './ModalSheetBody';
import ModalSheetFooterComponent from './ModalSheetFooter';

// ===== 组件导出 =====
export { default as ModalSheet, useModalSheetContext } from './ModalSheet';
export { default as ModalSheetHeader } from './ModalSheetHeader';
export { default as ModalSheetBody } from './ModalSheetBody';
export { default as ModalSheetFooter } from './ModalSheetFooter';

// ===== 钩子导出 (从 hooks/index.ts 统一导入) =====
export {
  // 核心功能钩子
  useModalSheet,
  useDraggable,
  usePortal,

  // 交互功能钩子
  useSnapPoints,
  useMultiDirectionResize,
  useResizable,
  useGestureRecognition,

  // 体验增强钩子
  useTheme,
  useAccessibility,

  // 组件和工具
  ThemeProvider,
  ThemeToggle,
  AnimationVariantGenerator,

  // 预设配置
  LIGHT_THEME,
  DARK_THEME,
  ANIMATION_PRESETS,
  EASING_FUNCTIONS,

  // 命名空间导出
  ModalSheetHooks,
  ThemeSystem,
  AnimationSystem,
} from './hooks';

// ===== 类型导出 =====
export type {
  // 组件类型
  ModalSheetProps,
  ModalSheetHeaderProps,
  ModalSheetBodyProps,
  ModalSheetFooterProps,
  ModalSheetSize,
  ModalSheetPosition,
  ModalSheetAnimation,
  AnimationPreset,
  ModalSheetContextValue,
  ModalSheetRef,

  // 基础类型
  SnapPoint,
  Position,
  Size,
} from './types';

// 从 hooks 导出的类型
export type {
  // 调整大小类型
  ResizeDirection,
  ModalPosition,

  // 主题系统类型
  ThemeMode,
  ThemeColors,
  Theme,

  // 动画系统类型
  EasingFunction,
  AnimationConfig,
  ChainAnimationConfig,

  // 别名类型
  AnimationEasingFunction,
  ModalAnimationConfig,
  ModalChainAnimationConfig,
} from './hooks';

// ===== 复合组件导出 =====

/**
 * 便捷的复合组件使用方式
 *
 * 使用示例：
 * ```typescript
 * import { Modal } from '@/components/common/ModalSheet';
 *
 * <Modal.Sheet>
 *   <Modal.Header>标题</Modal.Header>
 *   <Modal.Body>内容</Modal.Body>
 *   <Modal.Footer>底部</Modal.Footer>
 * </Modal.Sheet>
 * ```
 */
export const Modal = {
  Sheet: ModalSheetComponent,
  Header: ModalSheetHeaderComponent,
  Body: ModalSheetBodyComponent,
  Footer: ModalSheetFooterComponent,
} as const;
